import {MatIconRegistry} from '@angular/material';
import {DomSanitizer} from '@angular/platform-browser';

export const loadSvgResource = (ir: MatIconRegistry, ds: DomSanitizer) => {
  const iconDir = 'assets/static/images/icons';
  const iconsName = [
    'arrow_drop_down', 'format_color_fill', 'help', 'email', 'visibility', 'visibility_off', 'textsms', 'person', 'add',
    'logo', 'home', 'download', 'up', 'complete', 'diamond', 'gold', 'level', 'rate', 'torrent', 'forum', 'default_avatar', 'signed',
    'up_avatar', 'music', 'movie', 'game', 'software', 'book', 'study', 'pin'
  ];
  iconsName.forEach(name => {
    ir.addSvgIcon(name, ds.bypassSecurityTrustResourceUrl(`${iconDir}/${name}.svg`));
  });
};
